port_number(addr_string) := port if {
    strings := split(addr_string,":")
    port := to_number(strings[1])
    is_number(input.version)
}

url := "127.0.0.1:80"
port_of_url := port_number(url)

port_number(addr_string) := port if {
    port := "unknown"
    not is_number(input.version)
}
